package com.aabbc.mongodb.document;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.Date;

/**
 * OrderDocument
 *
 * @author: <a href="mailto:chenfenghai@oristartech.com">chenfenghai</a>
 * @version: 1.0
 * @date: 2019-11-26 14:28
 */
@Data
@ToString
@NoArgsConstructor
@EqualsAndHashCode
@Document("order")
public class OrderDocument implements Serializable {

    @Id
    private Long orderId;

    private String orderCode;

    private String orderType;

    private String orderStatus;

    private Double orderPrice;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern ="yyyy-MM-dd'T'HH:mm:ss",timezone="GMT+8")
    private Date orderTime;
}
